package unfriendlynumbers;

import java.io.IOException;
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;

public class Solution {
	private static long gcd(long max, long min) {
		if(min == 0)
			return max;
		return gcd(min, max % min);
	}
	private static Set<Long> factors(long K) {
		Set<Long> F = new HashSet<Long>(); // factors of K
		long r = (long)Math.sqrt(K);
		for(long i = 1; i <= r; i++) {
			if(K % i == 0) {
				F.add(i);
				long h = K / i; // K / i will be factor too
				if(h != i)
					F.add(h);
			}
		}
		return F;
	}
	public static void main(String[] args) throws IOException {
		Scanner in = new Scanner(System.in);
		try {
			int N = in.nextInt(); // number of unfriendly numbers
			long K = in.nextLong(); // friendly number
			long U[] = new long[N]; // unfriendly numbers
			for(int i = 0; i < N; i++)
				U[i] = in.nextLong();
			Set<Long> S = new HashSet<Long>(); // GCD of K and U
			for(int i = 0; i < N; i++)
				S.add(gcd(Math.max(K, U[i]), Math.min(K, U[i])));
			Set<Long> F = factors(K); // factors of K
			for(long G : S)
				F.removeAll(factors(G)); // remove factors of G from factors of K
			System.out.println(F.size());
		} finally {
			in.close();
		}
	}
}
